home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 4.3 KB | 153 lines |
- '***************************
- '* AMOS Professional *
- '* *
- '* MENUS 7 *
- '* * ANIMATED MENUS
- '* (c) Europress Software * MENU FUNCTIONS
- '* * AND
- '* Ronnie Simpson * MOVING MENUS
- '***************************
- '
- '-------------------------------------------
- 'Menu Called
- '-------------------------------------------
- 'automatic redrawing of a selected menu
- '
- 'The Menu Called instruction is used in conjunction with a menu procedure
- 'allowing animated items.
- 'The menu will automatically be redrawn 50 times a second whenever it is
- 'displayed on the screen whilst the Menu Called is active.
- 'The procedures called must be kept fairly short so as not to destroy the
- 'effect and bobs may tend to flicker as the menu cannot be double buffered.
- 'A typical set up might look something like this:-
- '
- ' Menu$(1,1)="(REserve 4:Proc TEST)"
- ' Menu Called(1,1)
- ' : :
- '
- ' Procedure TEST
- ' : :
- ' End Proc
- '
- '-------------------------------------------
- 'Menu Once
- '-------------------------------------------
- 'turn off automatic redrawing
- '
- 'Menu Once switches off the automatic redrawing produced by the Menu Called
- 'command and returns the system to normal.
- '
- 'eg. Menu Once
- '
- '-------------------------------------------
- 'X Menu
- '-------------------------------------------
- 'return an x coordinate from a menu item
- '
- 'The value returned by the X Menu function is not a normal screen
- 'coordinate but the X value relative to the start position of the
- 'menu item selected.
- '
- 'eg. X=X Menu(2,1)
- '-------------------------------------------
- 'Y Menu
- '-------------------------------------------
- 'return a Y coordinate from a menu item
- '
- 'Same as the above X Menu function only the Y coordinate is returned.
- '
- '-------------------------------------------
- 'Menu Base
- '-------------------------------------------
- 'move the menu display starting point
- '
- 'eg. Menu Base 100,50
- '
- 'the above example would cause the menu to be displayed starting at the
- 'screen coordinates given in the parameters, all other menu items would
- 'now be displayed relative to this point.
- '
- '-------------------------------------------
- 'Set Menu
- '-------------------------------------------
- 'move a menu item
- '
- 'Set Menu sets the coordinates of the top left corner of a menu item, these
- 'coordinates are measured relative to the previous level settings.
- 'All subsequent levels will also be moved by this instruction.
- 'Values can also be negative allowing menu items to appear above the menu
- 'bar (or in any position for that matter).
- '
- 'eg. Set Menu(2,1) To 40,-50
- '
- '-------------------------------------------
- 'WORKING EXAMPLES
- '-------------------------------------------
- Global C,N
- Rem *** tidy up the screen
- '
- Screen Open 0,640,200,16,Hires
- Palette $0,$F00,$F0,$F,$FF0,$F0F,$FF,$F70,$7F,$70F,$F07,$333,$666,$999,$CCC,$FFF
- Flash Off : Curs Off : Cls 0 : Pen 0 : Paper 8
- '
- Rem *** set the menu titles
- '
- Menu Static 1
- Menu$(1)=" TITLE 1 ","(SS4) TITLE 1 (ss0)"
- Menu$(2)="TITLE 2 ","(ss4)TITLE 2 (ss0)"
- Menu$(3)="TITLE 3 ","(SS4)TITLE 3 (ss0)"
- '
- Rem *** set menu options
- '
- Menu$(1,1)="(PRoc TEST)"
- Menu$(1,2)=" NEAT EH! ","(in1,4)(SS4) WOW! (ss0)"
- '
- Paper 5
- Menu$(2,1)=" "
- Menu$(2,2)=" USE SET MENU "
- Menu$(2,3)=" INSTRUCTION "
- Menu$(2,4)=" TO RE-POSITION "
- Menu$(2,5)=" OPTIONS. "
- Menu$(2,6)=" ^^^^^^^^^^^^^^^ "
- '
- Paper 4
- Menu$(3,1)=" QUIT "
- '
- Menu Base 40,80
- '
- Rem *** position menu options
- Set Menu(1,1) To 10,14
- Set Menu(1,2) To 0,68
- Set Menu(2,1) To -32,-56
- Set Menu(3,1) To 0,34
- '
- Rem *** activate menu
- Menu On
- '
- Rem *** start auto updating
- Menu Called(1,1)
- '
- Rem *** start a loop and check for quit
- '
- Paper 0 : Pen 2
- Locate 0,24 : Centre "HOLD RIGHT MOUSE KEY TO SEE MENU"
- Do
- If Choice(1)=3
- If Choice(2)=1
- Edit
- End If
- End If
- Loop
- '
- Procedure TEST
- Ink C
- Draw 52+N*2,94 To 178-N*2,158
- Draw 178,94+N To 52,158-N
- Ink 0 : Circle 115,126,N/2+1
- Add N,1,0 To 63
- If N=1
- Add C,1,1 To 7
- End If
- Dreg(0)=130
- Dreg(1)=65
- End Proc